package cifrasong.usuario.gui;
import cifrasong.cifra.gui.*;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import cifrasong.R;

public class MenuPrincipalAct extends Activity {

    public void onBackPressed(){
        Intent intent = new Intent();
        intent.setClass(MenuPrincipalAct.this, null);
        startActivity(intent);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_menu_principal);

        Button pesquisaCifras = (Button) findViewById(R.id.PesquisaCifras);
        Button minhasCifras = (Button) findViewById(R.id.MinhasCifras);
        Button favoritos = (Button) findViewById(R.id.Favoritos);
        Button editarDados = (Button) findViewById(R.id.editarDados);
        Button sair = (Button) findViewById(R.id.sair);


        pesquisaCifras.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i = new Intent();
                i.setClass(MenuPrincipalAct.this,PesquisaAct.class);
                startActivity(i);
            }
        });

        minhasCifras.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i = new Intent();
                i.setClass(MenuPrincipalAct.this,MinhaCifraAct.class);
                startActivity(i);
            }
        });

        favoritos.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i = new Intent();
                i.setClass(MenuPrincipalAct.this,FavoritoAct.class);
                startActivity(i);
            }
        });

        editarDados.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i = new Intent();
                i.setClass(MenuPrincipalAct.this, EditarDadosAct.class);
                startActivity(i);
            }
        });

        sair.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i = new Intent(MenuPrincipalAct.this, LoginAct.class);
                i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
                startActivity(i);
            }
        });
    }
}